package goroutine

import "fmt"

/*
in_channel ： 只读Channel 读取写好的数据
out_channel ： 只写Channel 写出读好的数据
*/
func onlyRecv(in_channel <-chan string, out_channel chan<- string) {
	data := <-in_channel
	out_channel <- data
}

func onlySend(channel chan<- string) {
	channel <- "写个数据进去"
}

func DemoSingleChannel() {
	send_use := make(chan string)
	recv_use := make(chan string)
	go onlySend(send_use)
	go onlyRecv(send_use, recv_use)

	fmt.Println("Recv方法记录: ", <-recv_use)
}
